
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@hyperjump/uri
Advanced tools
A small and fast library for validating parsing and resolving URIs and IRIs
A small and fast library for validating, parsing, and resolving URIs (RFC 3986) and IRIs (RFC 3987).
Designed for node.js (ES Modules, TypeScript) and browsers.
npm install @hyperjump/uri
import { resolveUri, parseUri, isUri, isIri } from "@hyperjump/uri"
const resolved = resolveUri("foo/bar", "http://example.com/aaa/bbb"); // https://example.com/aaa/foo/bar
const components = parseUri("https://jason@example.com:80/foo?bar#baz"); // {
// scheme: "https",
// authority: "jason@example.com:80",
// userinfo: "jason",
// host: "example.com",
// port: "80",
// path: "/foo",
// query: "bar",
// fragment: "baz"
// }
const a = isUri("http://examplé.org/rosé#"); // false
const a = isIri("http://examplé.org/rosé#"); // true
These functions resolve relative-references against a base URI/IRI. The base
URI/IRI must be absolute, meaning it must have a scheme (https) and no
fragment (#foo). The resolution process will normalize the
result.
These functions apply the following normalization rules.
/., /..) in paths.These functions convert a non-relative URI/IRI into a relative URI/IRI given a base.
A URI is not relative and may include a fragment.
isUri: (value: string) => boolean
parseUri: (value: string) => IdentifierComponents
toAbsoluteUri: (value: string) => string
Takes a URI and strips its fragment component if it exists.
A URI-reference may be relative.
An absolute-URI is not relative an does not include a fragment.
An IRI is not relative and may include a fragment.
isIri: (value: string) => boolean
parseIri: (value: string) => IdentifierComponents
toAbsoluteIri: (value: string) => string
Takes an IRI and strips its fragment component if it exists.
An IRI-reference may be relative.
An absolute-IRI is not relative an does not include a fragment.
Run the tests
npm test
Run the tests with a continuous test runner
npm test -- --watch
FAQs
A small and fast library for validating parsing and resolving URIs and IRIs
The npm package @hyperjump/uri receives a total of 69,061 weekly downloads. As such, @hyperjump/uri popularity was classified as popular.
We found that @hyperjump/uri demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.